# coding:utf-8
from pyspark import SparkConf, SparkContext
import os

os.environ['JAVA_HOME'] = '/server/jdk'

if __name__ == '__main__':
    conf = SparkConf().setAppName('test').setAppName('local[*]')
    sc = SparkContext(conf=conf)

    rdd1 = sc.parallelize([1,2,3,4,5,6,7,8,9],3)  #构建分区
    print(rdd1.glom().collect())  #查看分区排布

    print(rdd1.glom().flatMap(lambda x:x).collect())   #增解嵌套
